import java.util.Random;
import java.util.Scanner;

public class RandomDemo {
    public static void main(String[] args) {
        Random r = new Random();
        int input=r.nextInt(100)+1;
        Scanner scanner=new Scanner(System.in);
        int less=0;
        int high=100;
        int maxCount=3;
        while (true){
            if(maxCount==0){
                System.out.println("次数用完了，滚！");
                break;
            }
            System.out.println("请开始猜数字！（"+less+"~"+high+"）,你还有"+maxCount+"次机会");
            int i = scanner.nextInt();
            if (i<=less||i>=high){
                maxCount--;
                System.out.println("你他妈乱输是吧？");
                continue;
            }
            if (i<input) {
                maxCount--;
                less=i;
                System.out.printf("小了,结果在%d和%d之间\n",less,high);
            }else if(i>input){
                maxCount--;
                high=i;
                System.out.printf("大了,结果在%d和%d之间\n",less,high);
            }else {
                System.out.println("你他妈可真会蒙！");
                break;
            }
        }
    }
}
